home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / COMLIN.H < prev    next >
C/C++ Source or Header  |  1992-04-17  |  3KB  |  102 lines

  1. /* -*-C-*-
  2.  
  3. Copyright (c) 1987-1992 Massachusetts Institute of Technology
  4.  
  5. This material was developed by the Scheme project at the Massachusetts
  6. Institute of Technology, Department of Electrical Engineering and
  7. Computer Science.  Permission to copy this software, to redistribute
  8. it, and to use it for any purpose is granted, subject to the following
  9. restrictions and understandings.
  10.  
  11. 1. Any copy made of this software must include this copyright notice
  12. in full.
  13.  
  14. 2. Users of this software agree to make their best efforts (a) to
  15. return to the MIT Scheme project any improvements or extensions that
  16. they make, so that these may be included in future releases; and (b)
  17. to inform MIT of noteworthy uses of this software.
  18.  
  19. 3. All materials developed as a consequence of the use of this
  20. software shall duly acknowledge such use, in accordance with the usual
  21. standards of acknowledging credit in academic research.
  22.  
  23. 4. MIT has made no warrantee or representation that the operation of
  24. this software will be error-free, and MIT is under no obligation to
  25. provide any services, by way of maintenance, update, or otherwise.
  26.  
  27. 5. In conjunction with products arising from the use of this material,
  28. there shall be no use of the name of the Massachusetts Institute of
  29. Technology nor of any adaptation thereof in any advertising,
  30. promotional, or sales literature without prior written consent from
  31. MIT in each case. */
  32.  
  33. /* $Header: /scheme/src/microcode/RCS/comlin.h,v 1.5 1992/04/18 00:27:35 jinx Exp $
  34.  *
  35.  * This file contains definitions for the scheme command parser.
  36.  *
  37.  */
  38.  
  39. #ifndef COMLIN_H_INCLUDED
  40. #define COMLIN_H_INCLUDED
  41.  
  42. #include "ansidecl.h"
  43.  
  44. #ifndef boolean
  45. #  define boolean    int
  46. #endif
  47. #ifndef true
  48. #  define true        1
  49. #endif
  50. #ifndef false
  51. #  define false        0
  52. #endif
  53.  
  54. typedef char *string;
  55.  
  56. /* Argument List Keyword Descriptor Structure */
  57.  
  58. #define LAST_KYWRD    0
  59. #define BOOLEAN_KYWRD    1
  60. #define INT_KYWRD    2
  61. #define DOUBLE_KYWRD    3
  62. #define STRING_KYWRD    4
  63.  
  64. #define BOOLEAN_LVALUE(struc)    ((boolean *) ((struc).data))
  65. #define INT_LVALUE(struc)    ((int *) ((struc).data))
  66. #define DOUBLE_LVALUE(struc)    ((double *) ((struc).data))
  67. #define STRING_LVALUE(struc)    ((string *) ((struc).data))
  68.  
  69. struct keyword_struct
  70. {
  71.   int        type_tag;
  72.   string    keyword;
  73.   long        *data;
  74.   string    format;
  75.   boolean    *supplied_p;
  76. };
  77.  
  78. #define KEYWORD(str, var, type, format, sup)                \
  79. {                                    \
  80.   type,                                    \
  81.   ((string) str),                            \
  82.   ((long *) var),                            \
  83.   format,                                \
  84.   sup                                    \
  85. }
  86.  
  87. #define END_KEYWORD()    KEYWORD("", NULL, LAST_KYWRD, NULL, NULL)
  88.  
  89. /* Fake boolean and string formats */
  90.  
  91. #define BFRMT    ((string) NULL)
  92. #define SFRMT    ((string) NULL)
  93.  
  94. /* Exports */
  95.  
  96. extern char *program_name;
  97.  
  98. extern void EXFUN (parse_keywords,
  99.            (int, char **, struct keyword_struct *, boolean));
  100.  
  101. #endif /* COMLIN_H_INCLUDED */
  102.